<?php
/**
 * Created by PhpStorm.
 * User: yunpeng
 * Date: 2019/1/9
 * Time: 9:50
 */

namespace App\Admin\Extensions\Tools;

use Encore\Admin\Admin;
use Encore\Admin\Grid\Tools\AbstractTool;
use Illuminate\Support\Facades\Request;

class Excel extends AbstractTool
{
    protected function script()
    {

        //$url = Request::fullUrlWithQuery(['gender' => '_gender_']);

        return <<<EOT

$(function () {
            $("#a").bind("click",function(){
               if($('input[name="file"]').val()==null || $('input[name="file"]').val()==''){
                    alert("请先选择上传文件!");
                    return false;
                }
            });
        });

EOT;
    }

    public function render()
    {
        Admin::script($this->script());
        return view('admin.tools.subexcel');
    }
}